#include "SimpleAudioEngine.h"
#include "BackGroundLayer.h"

using namespace cocos2d;
using namespace CocosDenshion;

BackGroundLayer* BackGroundLayer::node() {
	BackGroundLayer *layer = BackGroundLayer::create();
	return layer;
}

bool BackGroundLayer::init() {
	if(!CCLayer::init())
	{
		return false;
	}
	CCSprite *backgroundImage = CCSprite::create("background.png");
	CCSize screenSize = CCDirector::sharedDirector()->getWinSize();
	CCSize imgSize = backgroundImage->boundingBox().size;
	backgroundImage->setPosition(CCPointMake(screenSize.width/2, screenSize.height/2));
	backgroundImage->setScaleX(screenSize.width/imgSize.width);
	backgroundImage->setScaleY(screenSize.height/imgSize.height);
	this->addChild(backgroundImage,0,0);
	return true;
}
